package com.ruoyi.pay.controller;

import com.repair.api.pay.request.param.PayQueryParam;
import com.repair.api.pay.response.vo.PaymentInfoVO;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.pay.service.PayService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @author chunyu
 * @since 2024/10/20,18:50
 */
@Api(tags = "支付模块")
@RestController
@RequestMapping("/admin/pay")
public class PayController {

    @Autowired
    private PayService payService;

    @ApiOperation("查询支付单分页")
    @GetMapping("getPayList")
    public R<TableDataInfo> getPayList(PayQueryParam param) {
        TableDataInfo map = payService.getPayList(param);
        return R.ok(map);
    }

    @ApiOperation("查询支付单详情")
    @GetMapping("getPayDetail")
    public R<PaymentInfoVO> getPayDetail(String payOrderNum) {
        PaymentInfoVO paymentInfoVO = payService.getPayDetail(payOrderNum);
        return R.ok(paymentInfoVO);
    }



}
